import 'package:flutter/material.dart';
import 'package:yuan_hang_app/base/base_state.dart';
import 'package:yuan_hang_app/base/full_base_page.dart';
import 'package:yuan_hang_app/res/w_colors.dart';
import 'package:yuan_hang_app/utils/router_helper.dart';
import 'package:yuan_hang_app/utils/size_utils.dart';
import 'package:yuan_hang_app/widget/w_line.dart';
import 'package:yuan_hang_app/widget/w_text.dart';
import 'package:yuan_hang_app/widget/webview_page.dart';

class AboutPage extends StatefulWidget {
  @override
  _AboutPageState createState() => _AboutPageState();
}

class _AboutPageState extends BaseState<AboutPage> {
  @override
  FullBasePage buildState(BuildContext context) {
    return FullBasePage(
        title: "关于App",
        child: Container(
          decoration: BoxDecoration(color: Colors.white, boxShadow: [
            BoxShadow(
                color: WColors.CDFEFFB, //阴影颜色
                blurRadius: 3.px,
                offset: const Offset(0, 1)),
          ]),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              GestureDetector(
                onTap: () {
                  RouteHelper.pushWidget(
                      context,
                      WebViewPage(
                          url:
                              "https://cms-minio.dayunauto.com:19010/dydata/user_service_agreement.html",
                          title: "用户服务协议"));
                },
                child: Container(
                  color: Colors.white,
                  height: 50.px,
                  alignment: Alignment.center,
                  padding: EdgeInsets.only(left: 24.px, right: 18.px),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      WText(
                        "用户服务协议",
                        style: TextStyle(
                            color: WColors.subTextColor, fontSize: 14.px),
                      ),
                      Image.asset(
                        "images/ic_right.png",
                        width: 12.px,
                      )
                    ],
                  ),
                ),
              ),
              WLine(),
              GestureDetector(
                onTap: () {
                  RouteHelper.pushWidget(
                      context,
                      WebViewPage(
                        url:
                            "https://cms-minio.dayunauto.com:19010/dydata/privacy_agreement.html",
                        title: "隐私政策",
                      ));
                },
                child: Container(
                  height: 50.px,
                  alignment: Alignment.center,
                  color: Colors.white,
                  padding: EdgeInsets.only(left: 24.px, right: 18.px),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      WText(
                        "隐私政策",
                        style: TextStyle(
                            color: WColors.subTextColor, fontSize: 14.px),
                      ),
                      Image.asset(
                        "images/ic_right.png",
                        width: 12.px,
                      )
                    ],
                  ),
                ),
              )
            ],
          ),
        ));
  }
}
